package com.gyx.rocsun.bootstrap;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import java.io.Reader;

/**
 * @program: rocsun
 * @description:
 * @author: yx.guo
 * @create: 2024-08-27 01:25
 **/
@Aspect
public class TestAspect {
    // 切入点
    @Pointcut("execution(* com.gyx.rocsun.service.impl.*.*(..))")
    public void pointcut(){}

    @Around("pointcut()")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
        joinPoint.getKind();
        Object result = joinPoint.proceed(joinPoint.getArgs());

        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build((Reader) null);

        return result;
    }

}
